package cn.com.zero.common.log.service.impl;

import cn.com.zero.base.service.BaseService;
import cn.com.zero.common.log.mapper.ILogMapper;
import cn.com.zero.common.log.service.ILogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author xiongxj
 * @version 1.0.0
 * @Description 日志操作service实现类
 * @createTime 2023/2/9 16:36
 */
@Service
@Transactional(rollbackFor = Throwable.class)
public class LogService extends BaseService implements ILogService {
    private ILogMapper logMapper;

    @Override
    public void exportHistoryLog() {
        logger.info("准备执行日志转入历史操作...");
        logMapper.exportHistoryLog();
        logMapper.deleteCurrentLog();
        logger.info("执行日志转入历史操作完毕！");
    }

    @Autowired
    public void setLogMapper(ILogMapper logMapper) {
        this.logMapper = logMapper;
    }
}
